<?php
class Comment_ServiceController extends Clu_Controller_Action_Hvn
{
	public $m; //model

	public function init()
	{
		$this->m = new comment_Model_Service();
		parent::init();
	}
	
	public function getCommentAction()
	{
		$sess = new Zend_Session_Namespace(CLU_NS);
		$data['content_type'] = $this->_request->getParam('parentContentType');
		$data['content_id'] = $this->_request->getParam('parentContentId');
		
//		die_a($data);
		$form = new comment_comment_Form_CommentSearch();
		$form->cluBuild(array('control' => 'service'));
	        $this->view->form = $form;
		if ($this->_request->isXmlHttpRequest())
		{
    		$cList = $this->m->search($data);
           	$this->view->cList = $cList;
           	if ($this->_request->isXmlHttpRequest())
           	{           	
        		$text = $this->view->render('en/index/commentList.phtml');
        		$ret['commentList'] = $text;
        		$this->_helper->json->sendJson($ret);
           	}
           	else
           	{
           		$text = $this->renderToHolder('index/commentList.phtml');
           	}
		}
    }
}
?>